<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>查看简历</title>
<link type="text/css" href="../../css/shCompany.css" rel="stylesheet" >
<link type="text/css" href="../../js/jDialog/jDialog.css" rel="stylesheet" >
<script type="text/javascript" src="../../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../js/jDialog/jquery.dialog.js"></script>
</head>
<script type="text/javascript" >
var sumPage=1;//总页数
var nowPage=1;//当前页数
var nowCount=1;//一页显示的条数
var sumCount=0;//总条数
var nowMin=1;//当前显示第一排的序号
var nowMax=1;//当前显示最后第一排的序号
var companyObj =window.companyObj;
var companyId = companyObj[0].companyId;
var ResumeObj=null;
var ResumeObjString = null;
var i;
$(document).ready(function() {
	$.ajax({
		type : 'post',
		dataType : 'text',
		async: false,
		url : '../../deliver/getResumeList.action',
		data:{
			"companyDTO.companyId":companyId
		},
		success : function(msg) {
			ResumeObjString=msg;
			if(ResumeObjString.length<=2){
				sumCount=0;
			}else{
				ResumeObj = JSON.parse(msg);
				sumCount = ResumeObj.length;
 				for(i=0;i<nowCount;i++)
 					$.appendTip(i);
 				nowMin=1;
 				nowMax=i;
			}
			$("#sumCount").html(sumCount);
		}
	});
	if(sumCount == 0){
		$("#tableInfo").append("<tr><td colspan='4'>没有数据</td></tr>");
		$.InitValue(0,0);
	}else{
		if(sumCount%nowCount==0)
			sumPage=sumCount/nowCount;
		else
			sumPage=Math.floor(sumCount/nowCount)+1;//根据记录数和每页显示条数获取总页数
		$.InitValue(1,nowMax);
	}
	$.checkPagesnum();
});
$.appendTip = function(j){
	$("#tableInfo").append("<tr><td>"+(j+1)+"</td><td title='查看简历' attr='查看简历' onclick='$.getRecumInfo(this)' id="+ResumeObj[i].userId+" style='cursor:pointer'>"+ResumeObj[j].userName+"</td><td>"+ResumeObj[j].recruitmentPosition+"</td><td><input type='button' value='通  过' onclick='$.deliverResum("+ResumeObj[j].userId+","+ResumeObj[j].deliverId+","+ResumeObj[j].recruitmentId+",1)' class='opbun' />&nbsp;&nbsp;&nbsp;<input type='button' value='拒  绝' onclick='$.deliverResum("+ResumeObj[j].userId+","+ResumeObj[j].deliverId+","+ResumeObj[j].recruitmentId+",-1)' class='opbun' style='background-color:#8B0000;'/></td></tr>");
}
$.getRecumInfo = function(th){
	var i=th.id;
	var dialog = jDialog.iframe('resumeInfo.html?userId='+i,{
		title : "简历信息",
		width : 800,
		height : 500,
	});
}
$.deliverResum = function(userId,deliverId,recruitmentId,deliverStatus){
	var title;
	if(deliverStatus==-1)
		title = "确定拒绝该求职者？"
	else
		title = "确定让该求职者通过？";	
	var dialog = jDialog.confirm(title,{
		handler : function(button,dialog) {
			$.ajax({
				type : 'post',
				dataType : 'text',
				data:{
					"deliverDTO.userId":userId,
					"deliverDTO.deliverId":deliverId,
					"deliverDTO.recruitmentId":recruitmentId,
					"deliverDTO.deliverStatus":deliverStatus
				},
				url : '../../deliver/upDeliver.action',
				success : function(msg) {
					if(msg == 1)
						alert("操作成功");
					else
						alert("操作失败");
				    parent.location.reload();
				}
			});
			dialog.close();
		}
	},{
		handler : function(button,dialog) {
			dialog.close();
		}
	});
 }
</script>
<script type="text/javascript" src="../../js/showInfolist.js"></script>
<body>
<div class="mineInfo">
<span id="info1">求职信息&nbsp;REQUIREMENT</span>
<hr style="height:1px;border:none;border-top:1px solid #555555;" />
</div>
<div id="seleDiv">
<span>一页显示</span><select onchange="$.changCount(this)"><option selected="selected">1</option><option>2</option><option>3</option><option>4</option><option>5</option></select><span>条记录</span>
</div>
<table id="tableInfo" border='1' rules="rows">
<tr>
<th width="22%">序号</th>
<th width="22%">求职者</th>
<th width="22%">岗位名称</th>
<th width="24%">操作</th>
</tr>
</table>
<div id="pageButton">
<a>当前显示<span id="firtLine" style="font-weight:bold;">0</span><span>到</span><span id="lastLine" style="font-weight:bold;">0</span><span>条,共</span><span id="sumCount" style="font-weight:bold;">2</span><span>条记录</span></a>
<a>第<span style="font-weight:bold;" id="nopage">1</span>/<span style="font-weight:bold;" id="alpage">1</span>页</a>
<span id="cpage"><a onclick="$.firstPage()" id="fipage">首页</a>
<a onclick="$.formPage()" id="fopage">上一页</a>
<a onclick="$.nextPage()" id="nepage">下一页</a>
<a onclick="$.lastPage()" id="lapage">尾页</a></span>
</div>
</body>
</html>